<% extends 'stock/weui_base.html' %>
<% block title %>出货单<% endblock %>
<% block body %>
<style>
    .weui_input{text-align: right}

    .weui-input-right{
    border-left: 1px solid #e5e5e5;
    color: #aaa;
    display: inline-block;
    font-size: 17px;
    height: 44px;
    line-height: 44px;
    margin-left: 5px;
    padding: 0 .6em 0 .7em;
    vertical-align: middle;
    }
    .no-reserved{
        color:red;
    }
</style>
<script>
    var picking_id = ${picking_id};
    var picking_user_name = '${picking_user_name|safe}';
    var state = '${picking_row.state}';
    var note = '${note}';
    var tracking_number ='${tracking_number}';
    if(note=='False'){
        note = ''
    }
    var from = '${from}';
    var picture_list_rows =  [ <% for picture in picking_row.picture_list_ids %> '${picture.image_sign}' <% endfor %> ];
    var packages_number = '${packages_number|safe}';
    var total_weight_kilo = '${total_weight_kilo|safe}';
    var shipping_type_sale = '${shipping_type_sale|safe}';
    var is_show_note_shipping_type = '${is_show_note_shipping_type|safe}';
    var user_list = ${user_list|to_json|safe};
    var user_id = ${user_id};
    var has_service_manager = ${has_service_manager|to_json};
    var delivery_user_id = ${delivery_user_id} + 0;
    var is_sign = ${is_sign|to_json};
    var move_lines = {
        <% for move_line in picking_row.move_lines %>
            ${move_line.id}: {
                product_qty: ${move_line.product_qty|int},
                reserved_availability: ${move_line.reserved_availability|int}
        },
        <% endfor %>
    };

    function LICENSES() {
        LODOP.SET_LICENSES("","CD9A14E608164F55F35D564059E8F43B","C94CEE276DB2187AE6B65D56B3FC2848","15F0BE661E7532B77491843CB2ED09AD");
    };

    function check_print_ok(){

        if (LODOP.CVERSION) LODOP.On_Return = function(TaskID, Value){
            if (Value == '1'){
                window.print_result_ok = true;
                document.getElementById("btn-print").className = "weui-form-preview-btn weui_btn weui_btn_disabled weui_btn_default";
            }
            else if (Value == '0'){
                document.getElementById("btn-print").className = "weui-form-preview-btn weui_btn weui_btn_disabled weui_btn_default";
                window.print_result_ok = false
            }
            setTimeout(function(){
                check_print_text();
            }, 100)
        };
        var strResult = LODOP.GET_VALUE('PRINT_STATUS_OK', window.task_name);
    }

    function check_print_text(){
        if (LODOP.CVERSION) LODOP.On_Return = function(TaskID, Value){
            document.getElementById("btn-print").innerHTML = Value;
            setTimeout(function(){
                check_print_job_exists();
            }, 100)
        };
        var strResult = LODOP.GET_VALUE('PRINT_STATUS_TEXT', window.task_name);
    }

    function check_print_job_exists(){
        if (LODOP.CVERSION) LODOP.On_Return = function(TaskID, Value){
            // 任务不存在
            if (Value == '0'){
                //任务不存在并且打印成功, 则隐藏打印按钮
                if (window.print_result_ok){
                    document.getElementById('btn-print').className = "weui-form-preview-btn weui_btn weui_btn_disabled weui_btn_default";
                    document.getElementById('btn-print').innerHTML = "打印成功";
                }
                //任务不存在并且打印不成功, 重新显示打印按钮
                else {
                    document.getElementById('btn-print').innerHTML = "重新打印";
                    document.getElementById('btn-print').className = "weui-form-preview-btn weui-form-preview-btn-primary";
                }
            }
            // 如果任务存在则继续检查打印结果
            else if (Value == '1'){
                setTimeout(function(){
                    check_print_ok();
                }, 300)
            }
        };
        var strResult = LODOP.GET_VALUE('PRINT_STATUS_EXIST', window.task_name);
    }

    function checkPrintResult(task_name){
        window.task_name = task_name;
        setTimeout(function(){
            check_print_ok();
        }, 100)
    }


//    function update_and_print_picking() {
//        //检查送货人是否有值
//        var values = $('#delivery-person-select').data('values');
//        var delivery_person_name = $('#delivery-person-select').val();
//        if (!delivery_person_name) {
//            $.toptips('请选择送货人');
//            return;
//        }
//        else {
//            $('#td_delivery_name').text(delivery_person_name);
//            $('#span_delivery_name').text(delivery_person_name);
//            var data = {delivery_user_id: values};
//            window.update_delivery_user_id(data).then(function (data) {
//                $.hideLoading();
//                print_picking();
//            }, function () {
//                $("#delivery-person-select").val('');
//                $.toast("送货人更新失败", "forbidden");
//            });
//        }
//    }

    function print_picking(){
        if (!LODOP.VERSION) return;
        LODOP.PRINT_INIT("东方团购中心新出货单${sale_order.name}");
        LODOP.SET_PRINT_PAGESIZE(1, 0, 2970, "A4"); //A4纸打印

        var printer_count = LODOP.GET_PRINTER_COUNT();
        var intPrinterIndex = -1;
        for (var i = 0; i < printer_count; i ++){
            if(LODOP.GET_PRINTER_NAME(i).indexOf('东方团购中心新出货单') >= 0){
                intPrinterIndex = i;
                break;
            }
        }
        if (intPrinterIndex == -1){
            alert('东方团购中心新出货单打印机不存在，无法打印');
            return;
        }
        <% if not fake_order_id %>
        LODOP.SET_PRINT_COPIES(3); //出货单默认为3张
        <% endif %>
        CreateOneFormPage1();
        if (LODOP.SET_PRINTER_INDEXA(intPrinterIndex+'')){
            document.getElementById('btn-print').innerHTML = "正在打印";
            document.getElementById('btn-print').className = "weui-form-preview-btn weui_btn weui_btn_disabled weui_btn_default";
            LODOP.SET_PRINT_MODE("CATCH_PRINT_STATUS",true);
            if (LODOP.CVERSION) {
                LODOP.On_Return = function (task_id, task_name) {
                    if (task_name){
                        checkPrintResult(task_name);
                    }
                    else{
                        document.getElementById('btn-print').innerHTML = '错误:无法获取打印任务'
                    }
                };
                LODOP.PRINT();
                return;
            }
            //LODOP.PRINT();
        }
    }

    function CreateOneFormPage1(){
        var strStyle = "<style>td{font-size:13px}</style>";
        LODOP.ADD_PRINT_TABLE(165, 20, "96%", 500, strStyle + document.getElementById("div-body").innerHTML);
        //LODOP.SET_PRINT_STYLEA(0,"TableHeightScope", 1);
        //LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
        //LODOP.SET_PRINT_STYLEA(0,"FontSize",8);

//        LODOP.ADD_PRINT_HTM(17, 120,"50%",200,document.getElementById("div-title").innerHTML);
//        LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
//        LODOP.SET_PRINT_STYLEA(0,"LinkedItem",1);

        LODOP.ADD_PRINT_HTM(75, 20,"96%",145,document.getElementById("div-header").innerHTML);
        LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
        LODOP.SET_PRINT_STYLEA(0,"LinkedItem",1);

        //送货人
        //LODOP.ADD_PRINT_HTM(720, 570, 200, 20, strStyle + document.getElementById("div-delivery-person").innerHTML);
        //LODOP.SET_PRINT_STYLEA(0,"ItemType",1);

        <% if not fake_order_id %>
        //反馈表
        strStyle = "<style>td{font-size:14px}</style>";
        LODOP.ADD_PRINT_HTM(760, 10, "96%", 280, strStyle + document.getElementById("div-feedback").innerHTML);
        LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
        //签收人
        LODOP.ADD_PRINT_HTM(1000, 10, "96%", 20, strStyle + document.getElementById("div-receiver-person").innerHTML);
        LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
        <% else %>
        LODOP.ADD_PRINT_TEXT(740, 300, 250, 150,"有假单");
        LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",50);
        <% endif %>

        //页码
        LODOP.ADD_PRINT_HTM(1025, 670, 150,30,"<span tdata='pageNO' style='font-size:12px'>第##页</span>/<span tdata='pageCount'  style='font-size:12px'>共##页</span>");
        LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
        //logo
//        LODOP.ADD_PRINT_IMAGE(0, 0, 100,60,"<img border='0' src='/dftg_lodop/static/src/img/800890_logo.jpg?3' width='100' height='60' />");
//        LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
        //条码
        LODOP.ADD_PRINT_BARCODE(8, 515, 230, 60, "Code93", "<% if picking_row.picking_type_id.id==1 %>IN<% endif %><% if picking_row.picking_type_id.id==2 %>OUT<% endif %>${ picking_row.id }");
        LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
        //二维码
        LODOP.ADD_PRINT_BARCODE(800, 670, 100, 100,"QRCode","${url_prefix}/wx/stock/picking_view/${picking_row.id}");
        LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
//        LODOP.ADD_PRINT_TEXT(1084, 630, 150, 20,"扫码打印出库单");
//        LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
//        LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
    };
$(function(){
    $('#btn-print').click(function(event){
        if (this.className.indexOf('disable') > 0){
            event.preventDefault()
        }
    });
})
</script>
<div style="display: none">
<div id="div-header">
    <table border="0" cellSpacing="0" cellPadding="0" width="100%" style="font-size:12px">
        <tbody>
            <tr>
                <td colspan="3" style="font-family:黑体;font-size:14px;">
                    上海汉兆实业有限公司<span style="font-family:黑体;font-size:16px;font-weight: bold">
                     <% if sale_order.is_return %>
                        退货单
                    <% else %>
                        <% if sale_order.is_exchange %>
                            换货单
                        <% else %>
                            出库单
                        <% endif %>
                    <% endif %>
                </span>
                </td>
            </tr>
            <tr>
                <td style="font-family:黑体;font-size:16px;font-weight: bold">
                    <!--${ sale_order.consignee}-->
                    <% if sale_order.real_so_id %> （必须本人签收） <% endif %>
                    <!--<% if picking_row.so_id.mobile_number %>-->
                            <!--&nbsp;&nbsp;-->
                            <!--手机:${ picking_row.so_id.mobile_number|default('', True) }-->
                        <!--<% endif %>-->
						 <!--<% if picking_row.so_id.phone_number %>-->
                        <!--电话:${ picking_row.so_id.phone_number|default('', True)}-->
						  <!--<% endif %>-->
                </td>
                <td width="55%" style="font-family:楷体;font-size:14px;">
                    ${ sale_order.name } ${ picking_row.name }
                </td>
                <!--<td width="33%">-->
                    <!--下单日期: ${ sale_order.date_order|default(sale_order.create_date,True)|strftime('%Y-%m-%d') }-->
                <!--</td>-->
                <td style="font-family:楷体;font-size:14px;font-weight: bold; padding-right:15px" align="right">
                    <% if sale_order.is_return %>
                    计划退货:
                    <% else %>
                    计划发货:
                    <% endif %>
                    ${ sale_order.expected_delivery_time }
                </td>
            </tr>
            <tr>
                <td colspan="2" style="font-family:楷体;font-size:15px;">

                    <!-- 企业名称 -->
                    <% if sale_order.partner_id.is_company %>
                        ${ sale_order.partner_id.name|default('', True) }
                    <% else %>
                        ${ sale_order.partner_id.name|default('', True) }${ sale_order.partner_id.parent_id.name|default('', True) }
                    <% endif %>
                    , 联系人:${picking_row.consignee}
                </td>
                <td style="padding-right:15px;font-family:楷体;font-weight: bold; font-size:16px;" align="right">
                    <% if picking_row.expected_delivery_time %>
                        具体时间: ${ sale_order.expected_delivery_hour }
                    <% else %>
                        未指定
                    <% endif %>
                </td>
            </tr>
            <tr><td colspan="3" align="right" style="padding-right:15px;font-family:黑体;font-size:14px;">
                地址:
                    <% if picking_row.province_id and picking_row.province_id.name != '上海市' %>
                    ${picking_row.province_id.name}
                    <% endif %>
                    <% if picking_row.city_id %>
                    ${picking_row.city_id.city_name}
                    <% endif %>
                    <% if picking_row.county_id %>
                    ${picking_row.county_id.county_name}
                    <% endif %>

                    ${ picking_row.street|default('', True) }
            </td></tr>
        </tbody>
    </table>
</div>


<div id="div-body">
    <table width="100%" border="0" cellSpacing="0" cellPadding="0" bordercolor="#000000" style="border-collapse:collapse;font-size:12px">
        <thead style="font-weight: bold">
            <tr>
                <td style="border-bottom: 1px solid #000000" width="15">#</td>
                <td nowrap="nowrap" style="border-bottom: 1px solid #000000">产品</td>
                <td nowrap="nowrap" style="border-bottom: 1px solid #000000">型号</td>
                <td nowrap="nowrap" style="border-bottom: 1px solid #000000">备注</td>
                <td nowrap="nowrap" style="border-bottom: 1px solid #000000; padding-right:15px" align="right">总数量</td>
                <td nowrap="nowrap" style="border-bottom: 1px solid #000000; padding-right:15px" align="right"><% if sale_order.is_return %>退货<% else %>本次<% endif %>数量</td>
                <% if sale_order.name != 'S18082048566' %>
                <td nowrap="nowrap" style="border-bottom: 1px solid #000000; padding-right:15px" align="right">单价</td>
                <td nowrap="nowrap" style="border-bottom: 1px solid #000000; padding-right:15px" align="right">小计</td>
                <% endif %>
            </tr>
        </thead>
        <tbody>
            <% for line in sale_order.order_line %>
            <tr>
                <td style="border-bottom: 1px solid #000000">${loop.index}</td>
                <td style="border-bottom: 1px solid #000000">
                        <span>${line.name}</span>
                </td>
                <!--<td style="border-bottom: 1px solid #000000">-->
                        <!--<span>${line.product_id.prod_model|default("", True)}</span>-->
                <!--</td>-->
                <td style="border-bottom: 1px solid #000000">
                        <span>${line.product_id.prod_model|default("", True)}</span>
                </td>
                <td style="border-bottom: 1px solid #000000">${line.prod_spec|default("", True)} ${line.sale_note|default(" ", True)}</td>
                <td style="border-bottom: 1px solid #000000; padding-right:5px" align="right">${ line.product_uom_qty|int }</td>
                <td style="border-bottom: 1px solid #000000; padding-right:5px" align="right"><% if move_lines_map.has_key(line.product_id.id) %>${ move_lines_map[line.product_id.id]|int|default(' ',True) }<% endif %></td>
                <% if sale_order.name != 'S18082048566' %>
                <td style="border-bottom: 1px solid #000000; padding-right:5px" align="right">${ line.price_unit }</td>
                <td style="border-bottom: 1px solid #000000; padding-right:5px" align="right">${ line.price_unit*line.product_uom_qty|round(2) }</td>
                <% endif %>
            </tr>
				<% for order_card in sale_order.sale_order_id %>
						<% if order_card.product_id.id==line.product_id.id %>
						<tr>
							<td></td>
							<td style="text-align: left;" colspan="7">
							券号:${order_card.starting_number.code}<% if order_card.continue_number!=1 %>~${order_card.ending_number}(${order_card.continue_number}张)<% else %> (${order_card.continue_number}张)<% endif %>
							</td>
						</tr>
						<% endif %>
				<% endfor %>
            <% endfor %>

            <tr><td colspan="5">
                <% if official_invoice_map.get(False) or official_invoice_map.get(True) %>
                    <!--<% if official_invoice_map.get(False) %>已开票:${official_invoice_map.get(False)}张<% endif %>-->
                    <!--<% if official_invoice_map.get(True) %>发票:${official_invoice_map.get(True)}张(W)<% endif %>-->
                    <% endif %>
                附带发票: _____张
                </td>
                <td colspan="3" align="right" style="padding-right:5px;">
                    <% if sale_order.name != 'S18082048566' %>
                    合计: ${sale_order.amount_total}
                    <% endif %>
                </td>
            </tr>

        </tbody>
        <tfoot>
          <tr>
            <td width="100%" colspan="4" style="font-size:13px;font-weight: bold;padding-right:5px">
                ${sale_order.note|default(' ',True)|replace('\n', '<br/>')|safe}<br/>
				${sale_order.partner_id.stock_auto_note|default(' ',True)|replace('\n', '<br/>')|safe}
            </td>
          </tr>
        </tfoot>
    </table>
</div>

<!--<div id="div-delivery-person">-->
    <!--<table border="0" cellSpacing="0" cellPadding="0" width="160">-->
        <!--<tr><td align="right" width="60">送货人:</td><td style="border-bottom: 1px solid #000000; padding-left:30px" width="100" id="td_delivery_name">&nbsp;</td></tr>-->
    <!--</table>-->
<!--</div>-->

<div id="div-feedback">
    <hr style="border: 0; height:1px; border-bottom: 1px dashed #000000" />
    <table border="0" cellSpacing="0" cellPadding="0" width="100%">
        <tr>
            <td style="font-family:黑体;font-size: 16px;font-weight: bold" colspan="4" align="center">
                <!--客户回执-->
            </td>
        </tr>
        <tr>
            <td colspan="4"><span style="font-family:楷体;font-size: 14px;font-weight: bold">${sale_order.partner_id.name}</span></td>
        </tr>
        <tr>
            <td colspan="4">订单: ${sale_order.name},
                付款方式: ☐<% if sale_order.payment_method =='现金'%><span style="margin-left:-12px">√</span><% endif %> 现金 &nbsp;
                ☐<% if sale_order.payment_method =='支票'%>√<% endif %> 支票 &nbsp;
                ☐<% if sale_order.payment_method =='转账'%><span style="margin-left:-12px">√</span><% endif %> 转账 &nbsp;
                ☐<% if sale_order.payment_method =='POS机'%><span style="margin-left:-12px">√</span><% endif %> POS机
            </td>
        </tr>
        <tr>
            <td colspan="4">出库单: ${picking_row.name}, 产品共${picking_row.move_lines|count}种, 中转箱(袋)共: _____箱(袋), 产品数量共:______(件 个 套)</td>
        </tr>
        <tr><td colspan="4">&nbsp;</td></tr>
        <tr><td colspan="4" style="padding-left:0px">注：1、为保障您的权益，准确无误后再进行签收。</td></tr>
        <tr><td colspan="4" style="padding-left:50px">务必请您在收货时与配送人员当场核对商品的</td></tr>
        <tr><td colspan="4" style="padding-left:50px">包装、种类、数量、规格等是否与订单一致。</td></tr>
        <tr><td colspan="4" style="padding-left:29px"></td></tr>
        <tr><td colspan="4" style="padding-left:29px">2、凡经签收，若非商品质量问题，一律不退不换。</td></tr>
        <tr><td colspan="4" style="padding-left:0px"></td></tr>
        <tr><td colspan="4">&nbsp;</td></tr>
        <tr><td colspan="4" style="padding-left:0px"></td></tr>
    </table>
</div>

<div id="div-receiver-person">
    <table border="0" cellSpacing="0" cellPadding="0" width="100%">
        <tr>
            <td width="120">销售:<span style="border-bottom: 1px solid #000000; padding-right:20px">${sale_order.user_id.name}</span></td>
            <td width="40">物流:</td>
            <td style="border-bottom: 1px solid #000000" width="150">&nbsp;</td>
            <td align="right" width="80">货品签收:</td>
            <td style="border-bottom: 1px solid #000000" width="150">&nbsp;</td>
            <td align="right" width="80">发票签收:</td>
            <td style="border-bottom: 1px solid #000000" width="150">&nbsp;</td>
        </tr>
    </table>
</div>

<div style="float:right; margin-top:-20px">
    <img src="/wx/work/qr_or_bar_code?type=QR&width=100&value=stock/tally/<% if sale_order.real_so_id %>${ sale_order.real_so_id.id }<% else %>${ sale_order.id }<% endif%>" width="100" height="100" />
</div>
</div>

<h3 style="text-align: center"><% if picking_row.picking_type_id.id==1 %>入库单<% endif %>
            <% if picking_row.picking_type_id.id==2 %>出库单<% endif %> 打印</h3>
<div class="weui-form-preview">
<form id="form-picking">

    <input id="picking_id" name="picking_id" type="hidden" value="${picking_id}" />
    <p class="page-hd-desc">销售员:${sale_order.user_id.name} 客户:${sale_order.partner_id.name}</p>
    <p v-if="has_service_manager || (user_id==delivery_user_id && !is_sign)" class="page-hd-desc">联系人:${picking_row.consignee} 手机:<a href="tel:${sale_order.mobile_number}">${picking_row.mobile_number}</a>
    电话:<a href="tel:${sale_order.phone_number}">${picking_row.phone_number}</a>
        <p>
        地址：<span>
                    <% if picking_row.province_id and picking_row.province_id.name != '上海市' %>
                    ${picking_row.province_id.name}
                    <% endif %>
                    <% if picking_row.city_id %>
                    ${picking_row.city_id.city_name}
                    <% endif %>
                    <% if picking_row.county_id %>
                    ${picking_row.county_id.county_name}
                    <% endif %>
                    ${ picking_row.street|default('', True) }</span>
        </p>
    </p>
    <div class="weui-form-preview-hd">
        <label class="weui-form-preview-label">
            ${sale_order.name}
            </label>
        <em class="weui-form-preview-value">${picking_row.name}</em>
    </div>

    <table width="100%" border="0" cellSpacing="0" cellPadding="0" bordercolor="#000000" style="border-collapse:collapse;font-size:12px">
        <thead style="font-weight: bold">
            <tr>
                <td style="border-bottom: 1px solid #aaa" width="15">#</td>
                <td style="border-bottom: 1px solid #aaa">产品名称</td>
                <td style="border-bottom: 1px solid #aaa">备注</td>
                <td nowrap="nowrap" style="border-bottom: 1px solid #aaa" align="right">数量</td>
            </tr>
        </thead>
        <tbody>
            <% for move_line in picking_row.move_lines %>
            <tr v-bind:class="{'no-reserved': !lines_stock_reserved[${move_line.id}]}">
                <td style="border-bottom: 1px solid #aaa">${loop.index}</td>
                <td style="border-bottom: 1px solid #aaa">
                        <span>${move_line.name}</span>
                </td>

                <td style="border-bottom: 1px solid #aaa">${move_line.prod_spec|default("", True)}</td>
                <td style="border-bottom: 1px solid #aaa" align="right">
                    {{ move_lines[${move_line.id}].product_qty }}
                    <% if picking_row.state == 'confirmed' %>
                    ({{ move_lines[${move_line.id}].reserved_availability }})
                    <% endif %>
                </td>
            </tr>
				<% for order_card in sale_order.sale_order_id %>
						<% if order_card.product_id.id==move_line.product_id.id %>
						<tr>
							<td></td>
							<td style="text-align: left;" colspan="7">
							券号:${order_card.starting_number.code}<% if order_card.continue_number!=1 %>~${order_card.ending_number}(${order_card.continue_number}张)<% else %> (${order_card.continue_number}张)<% endif %>
							</td>
						</tr>
						<% endif %>
				<% endfor %>
            <% endfor %>

            <% if official_invoice_map.get(False) or official_invoice_map.get(True) %>
            <tr><td colspan="8">
                <!--<% if official_invoice_map.get(False) %>开票:${official_invoice_map.get(False)}张<% endif %>-->
                <!--<% if official_invoice_map.get(True) %>开票:${official_invoice_map.get(True)}张(W)<% endif %>-->
                附带发票: _____张
            </td></tr>

            <% endif %>
        </tbody>
        <tfoot>
          <tr>
            <td width="100%" colspan="4" style="font-size:12px">
                ${sale_order.note|default(' ',True)|replace('\n', '<br/>')|safe}<br/>
				${sale_order.partner_id.stock_auto_note|default(' ',True)|replace('\n', '<br/>')|safe}
            </td>
          </tr>
        </tfoot>
    </table>
    <div class="weui-form-preview-hd">
        <label class="weui-form-preview-label">
            领货(送货)人:
            </label>
        <em class="weui-form-preview-value"><% if picking_row.delivery_user_id %>${picking_row.delivery_user_id.name}<%else%>未领货<% endif %></em>
    </div>
    <div class="weui-form-preview-ft">
        <template v-if="is_whole_reserved">
            (库存已锁)
        </template>
        <% if picking_row.state == 'confirmed' %>
        <template v-if="!is_whole_reserved && !delivery_user_id">
            <a class="weui-form-preview-btn weui-form-preview-btn-default" href="javascript:" v-on:click="picking_reserve">
            检查可用(未锁)</a>
        </template>
        <% endif %>
        <a id="btn-print" class="weui-form-preview-btn weui_btn_disabled" href="javascript:">网络问题, 不能打印</a>


    </div>
    <% if picking_row.delivery_start_time %>
        <div class="weui_msg_desc"><span slot="content">领货时间：${picking_row.delivery_start_time|strftime('%Y-%m-%d %H:%M')}</span></div>
    <% endif %>
    <!--<a id="picking-pickup" href="javascript:;" class="weui_btn bg-blue" v-on:click="picking_take_up">确认领货</a>-->
    <!--<a href="javascript:;" class="weui_btn bg-blue">批量领货</a>-->
    <template v-if="is_sign">
        <div class="weui_msg">
            <i class="weui_icon_success weui_icon_msg"></i>
            <div class="icon-box__ctn">
                <h3 class="icon-box__title">送货已完成</h3>
                <% if delivery_done_time %>
                <div class="weui_msg_desc"><span slot="content">签收时间：${delivery_done_time|strftime('%Y-%m-%d %H:%M')}</span></div>
                <% endif %>
            </div>
        </div>
    </template>
</form>
</div>
</div>
<script src="/dftg_weixin/static/src/js/stock/stock_app.js?v1.070"></script>
<script src="http://${lodop_host}/jsonp_lodop.js"></script>
<% endblock %>
